home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / ntsecu_1 / vb5form1.fr_ / vb5form1.fr (.txt)
Encoding:
Visual Basic Form  |  1997-06-01  |  10.2 KB  |  331 lines

  1. VERSION 5.00
  2. Begin VB.Form Form1 
  3.    BorderStyle     =   1  'Fixed Single
  4.    Caption         =   "NT Security Test"
  5.    ClientHeight    =   6300
  6.    ClientLeft      =   45
  7.    ClientTop       =   330
  8.    ClientWidth     =   4890
  9.    LinkTopic       =   "Form1"
  10.    MaxButton       =   0   'False
  11.    MinButton       =   0   'False
  12.    ScaleHeight     =   6300
  13.    ScaleWidth      =   4890
  14.    StartUpPosition =   3  'Windows Default
  15.    Begin VB.Frame Frame1 
  16.       Caption         =   "Domain Information"
  17.       Height          =   5115
  18.       Left            =   120
  19.       TabIndex        =   3
  20.       Top             =   1140
  21.       Width           =   4635
  22.       Begin VB.CommandButton Command2 
  23.          Caption         =   "Set"
  24.          Height          =   315
  25.          Index           =   4
  26.          Left            =   1200
  27.          TabIndex        =   25
  28.          Top             =   4680
  29.          Width           =   435
  30.       End
  31.       Begin VB.CommandButton Command2 
  32.          Caption         =   "Set"
  33.          Height          =   315
  34.          Index           =   3
  35.          Left            =   4140
  36.          TabIndex        =   24
  37.          Top             =   4320
  38.          Width           =   435
  39.       End
  40.       Begin VB.CommandButton Command2 
  41.          Caption         =   "Set"
  42.          Height          =   315
  43.          Index           =   2
  44.          Left            =   4140
  45.          TabIndex        =   23
  46.          Top             =   3960
  47.          Width           =   435
  48.       End
  49.       Begin VB.CommandButton Command2 
  50.          Caption         =   "Set"
  51.          Height          =   315
  52.          Index           =   1
  53.          Left            =   4140
  54.          TabIndex        =   22
  55.          Top             =   3600
  56.          Width           =   435
  57.       End
  58.       Begin VB.CommandButton Command2 
  59.          Caption         =   "Set"
  60.          Height          =   315
  61.          Index           =   0
  62.          Left            =   4140
  63.          TabIndex        =   21
  64.          Top             =   3240
  65.          Width           =   435
  66.       End
  67.       Begin VB.TextBox Text2 
  68.          Height          =   315
  69.          Index           =   3
  70.          Left            =   1560
  71.          TabIndex        =   20
  72.          Text            =   "<None>"
  73.          Top             =   4320
  74.          Width           =   2535
  75.       End
  76.       Begin VB.TextBox Text2 
  77.          Height          =   315
  78.          Index           =   2
  79.          Left            =   1560
  80.          TabIndex        =   19
  81.          Text            =   "<None>"
  82.          Top             =   3960
  83.          Width           =   2535
  84.       End
  85.       Begin VB.TextBox Text2 
  86.          Height          =   315
  87.          Index           =   1
  88.          Left            =   1560
  89.          TabIndex        =   18
  90.          Text            =   "<None>"
  91.          Top             =   3600
  92.          Width           =   2535
  93.       End
  94.       Begin VB.TextBox Text2 
  95.          Height          =   315
  96.          Index           =   0
  97.          Left            =   1560
  98.          TabIndex        =   17
  99.          Text            =   "<None>"
  100.          Top             =   3240
  101.          Width           =   2535
  102.       End
  103.       Begin VB.CheckBox Check2 
  104.          Caption         =   "Locked"
  105.          Enabled         =   0   'False
  106.          Height          =   195
  107.          Left            =   2400
  108.          TabIndex        =   16
  109.          Top             =   4740
  110.          Width           =   1455
  111.       End
  112.       Begin VB.CheckBox Check1 
  113.          Caption         =   "Disabled"
  114.          Height          =   195
  115.          Left            =   180
  116.          TabIndex        =   15
  117.          Top             =   4740
  118.          Width           =   1215
  119.       End
  120.       Begin VB.ListBox List2 
  121.          Height          =   1815
  122.          Left            =   2400
  123.          TabIndex        =   9
  124.          Top             =   1020
  125.          Width           =   1995
  126.       End
  127.       Begin VB.ListBox List1 
  128.          Height          =   1815
  129.          Left            =   180
  130.          TabIndex        =   7
  131.          Top             =   1020
  132.          Width           =   1995
  133.       End
  134.       Begin VB.Label Label6 
  135.          Caption         =   "Login Script:"
  136.          Height          =   195
  137.          Index           =   4
  138.          Left            =   180
  139.          TabIndex        =   14
  140.          Top             =   4380
  141.          Width           =   1335
  142.       End
  143.       Begin VB.Label Label6 
  144.          Caption         =   "Home Directory:"
  145.          Height          =   195
  146.          Index           =   3
  147.          Left            =   180
  148.          TabIndex        =   13
  149.          Top             =   4020
  150.          Width           =   1335
  151.       End
  152.       Begin VB.Label Label6 
  153.          Caption         =   "Comment:"
  154.          Height          =   195
  155.          Index           =   2
  156.          Left            =   180
  157.          TabIndex        =   12
  158.          Top             =   3660
  159.          Width           =   1335
  160.       End
  161.       Begin VB.Label Label6 
  162.          Caption         =   "Full Name:"
  163.          Height          =   195
  164.          Index           =   1
  165.          Left            =   180
  166.          TabIndex        =   11
  167.          Top             =   3300
  168.          Width           =   1335
  169.       End
  170.       Begin VB.Label Label6 
  171.          Caption         =   "Current User Information:"
  172.          Height          =   195
  173.          Index           =   0
  174.          Left            =   180
  175.          TabIndex        =   10
  176.          Top             =   2940
  177.          Width           =   3075
  178.       End
  179.       Begin VB.Label Label5 
  180.          Caption         =   "Users in selected group:"
  181.          Height          =   195
  182.          Left            =   2400
  183.          TabIndex        =   8
  184.          Top             =   780
  185.          Width           =   1935
  186.       End
  187.       Begin VB.Label Label4 
  188.          Caption         =   "Groups in domain:"
  189.          Height          =   195
  190.          Left            =   180
  191.          TabIndex        =   6
  192.          Top             =   780
  193.          Width           =   1935
  194.       End
  195.       Begin VB.Label Label3 
  196.          Caption         =   "<None>"
  197.          Height          =   315
  198.          Left            =   2460
  199.          TabIndex        =   5
  200.          Top             =   360
  201.          Width           =   2115
  202.       End
  203.       Begin VB.Label Label2 
  204.          Caption         =   "Primary Domain Controller:"
  205.          Height          =   315
  206.          Left            =   180
  207.          TabIndex        =   4
  208.          Top             =   360
  209.          Width           =   2055
  210.       End
  211.    End
  212.    Begin VB.CommandButton Command1 
  213.       Caption         =   "Get Info"
  214.       Default         =   -1  'True
  215.       Height          =   495
  216.       Left            =   3300
  217.       TabIndex        =   2
  218.       Top             =   240
  219.       Width           =   1215
  220.    End
  221.    Begin VB.TextBox Text1 
  222.       Height          =   315
  223.       Left            =   180
  224.       TabIndex        =   1
  225.       Text            =   "<Enter the name of your domain>"
  226.       Top             =   540
  227.       Width           =   2715
  228.    End
  229.    Begin VB.Label Label1 
  230.       Caption         =   "Enter the name of the domain to use:"
  231.       Height          =   255
  232.       Left            =   180
  233.       TabIndex        =   0
  234.       Top             =   180
  235.       Width           =   2715
  236.    End
  237. Attribute VB_Name = "Form1"
  238. Attribute VB_GlobalNameSpace = False
  239. Attribute VB_Creatable = False
  240. Attribute VB_PredeclaredId = True
  241. Attribute VB_Exposed = False
  242. Option Explicit
  243. ' Global variables
  244. Dim MyDomain As New NTDomain
  245. Private Sub Command1_Click()
  246.     Dim MyList() As String, i As Integer
  247.     ' Clear up any existing information
  248.     List1.Clear
  249.     List2.Clear
  250.     Label3.Caption = "<None>"
  251.     For i = 0 To 3
  252.         Text2(i) = "<None>"
  253.     Next i
  254.     Check1 = False
  255.     Check2 = False
  256.         
  257.     ' Now get new information
  258.     MyDomain.sDomain = Text1.Text
  259.     If MyDomain.sLastError = "SUCCESS" Then
  260.         ' Display PDC
  261.         Label3.Caption = MyDomain.sDC
  262.         MyDomain.Groups.Enumerate MyList
  263.         ' Add list of groups to the listbox
  264.         For i = 1 To UBound(MyList)
  265.             List1.AddItem MyList(i)
  266.         Next i
  267.     End If
  268. End Sub
  269. Private Sub Command2_Click(Index As Integer)
  270.     ' Set the appropriate property
  271.     Select Case Index
  272.         Case 0
  273.             MyDomain.Groups.Users.sFullName = Text2(0)
  274.         Case 1
  275.             MyDomain.Groups.Users.sComment = Text2(1)
  276.         Case 2
  277.             MyDomain.Groups.Users.sHomeDir = Text2(2)
  278.         Case 3
  279.             MyDomain.Groups.Users.sScriptPath = Text2(3)
  280.         Case 4
  281.             MyDomain.Groups.Users.bDisabled = (Check1.Value = 1)
  282.     End Select
  283.     ' Did it work?
  284.     If MyDomain.Groups.Users.sLastError <> "SUCCESS" Then Debug.Print MyDomain.Groups.Users.sLastError
  285. End Sub
  286. Private Sub Form_Load()
  287.     ' Center
  288.     Left = (Screen.Width - Me.Width) \ 2
  289.     Top = (Screen.Height - Me.Height) \ 2
  290. End Sub
  291. Private Sub List1_Click()
  292.     Dim MyList() As String, i As Integer
  293.     ' Clean up existing stuff
  294.     List2.Clear
  295.     For i = 0 To 3
  296.         Text2(i) = "<None>"
  297.     Next i
  298.     Check1 = False
  299.     Check2 = False
  300.     ' Set current group
  301.     MyDomain.Groups.sGroupName = List1.Text
  302.     If MyDomain.Groups.sLastError = "SUCCESS" Then
  303.         ' Get users in group
  304.         MyDomain.Groups.Users.Enumerate MyList
  305.         For i = 1 To UBound(MyList)
  306.             List2.AddItem MyList(i)
  307.         Next i
  308.     End If
  309. End Sub
  310. Private Sub List2_Click()
  311.     Dim i As Integer
  312.     ' Clear current stuff
  313.     For i = 0 To 3
  314.         Text2(i) = "<None>"
  315.     Next i
  316.     Check1 = False
  317.     Check2 = False
  318.     ' Set current user
  319.     MyDomain.Groups.Users.sUserName = List2.Text
  320.     If MyDomain.Groups.Users.sLastError = "SUCCESS" Then
  321.         With MyDomain.Groups.Users
  322.             Text2(0) = .sFullName
  323.             Text2(1) = .sComment
  324.             Text2(2) = .sHomeDir
  325.             Text2(3) = .sScriptPath
  326.             If .bDisabled Then Check1.Value = 1
  327.             If .bLockedOut Then Check2.Value = 1
  328.         End With
  329.     End If
  330. End Sub
  331.